package com.kongge.viewdisplayframework.page;

import android.app.ActionBar;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.kongge.viewdisplayframework.R;
import com.kongge.viewdisplayframeworklib.control.PublicInterface;
import com.kongge.viewdisplayframeworklib.event.action.EQGotoFrameAction;
import com.kongge.viewdisplayframeworklib.event.param.EQParam;
import com.kongge.viewdisplayframeworklib.model.NavigateItem;
import com.kongge.viewdisplayframeworklib.ui.Component;
import com.kongge.viewdisplayframeworklib.ui.ComponentContainer;

/**
 * Created by kongge on 2017/11/20.
 * description:
 * layoutid:
 */
public class Test01 extends LinearLayout implements ComponentContainer, Component {

    public Test01(Context context) {
        super(context);
    }

    public Test01(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void onPageFinishInflate() {
        Button btnJump1 = (Button) findViewById(R.id.btnJump1);
        btnJump1.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                EQGotoFrameAction action = new EQGotoFrameAction(EQGotoFrameAction.NO_ANIMATION, 1005);
                EQParam eqParam = new EQParam(EQParam.PARAM_TYPE_GOTO, "test01");
                action.setParam(eqParam);
                PublicInterface.gotoPageWithPageId(action);
            }
        });

        Button btnJump2 = (Button) findViewById(R.id.btnJump2);
        btnJump2.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                EQGotoFrameAction action = new EQGotoFrameAction(EQGotoFrameAction.NO_ANIMATION, 1006);
                EQParam eqParam = new EQParam(EQParam.PARAM_TYPE_GOTO, "test01");
                action.setParam(eqParam);
                PublicInterface.gotoPageWithPageId(action);
            }
        });

        Button btnJump3 = (Button) findViewById(R.id.btnJump3);
        btnJump3.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                EQGotoFrameAction action = new EQGotoFrameAction(EQGotoFrameAction.NO_ANIMATION, 1007);
                EQParam eqParam = new EQParam(EQParam.PARAM_TYPE_GOTO, "test01");
                action.setParam(eqParam);
                PublicInterface.gotoPageWithPageId(action);
            }
        });
    }

    @Override
    public void onBackground() {

    }

    @Override
    public void onForeground() {

    }

    @Override
    public void onRemove() {

    }

    @Override
    public void onActivity() {

    }

    @Override
    public void parseRunTimeParam(EQParam param) {

    }

    @Override
    public boolean getBottomVisible() {
        return true;
    }


    @Override
    public void onComponentContainerForeground() {

    }

    @Override
    public void onComponentContainerBackground() {

    }

    @Override
    public void onComponentContainerRemove() {

    }

    @Override
    public NavigateItem getTitleStruct() {
        NavigateItem navigateItem = new NavigateItem();
        navigateItem.setVisible(false);
        return navigateItem;
    }

    @Override
    public boolean onInnerBack() {
        return false;
    }
}
